<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="layout">
<head>
<title>会员等级管理</title>
</head>
<body>
<div layout:fragment="content">
	<div class="row">
		<div class="col-md-12">
			<div class="btn-group pull-right">
				<a href="index.html" th:href="@{/userRank/list/}" id="sample_editable_1_new" class="btn green">返回<i class="fa fa-arrow-circle-o-left"></i></a>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<div class="form">
				<form role="form" id="form" th:action="@{/userRank/save}" th:object="${userRank}" method="post" class="form-horizontal">
					<h4 class="form-section">会员等级信息</h4>
					<input type="hidden" th:field="*{id}" />
					<div class="form-body">
						<div class="form-group" th:classappend="${#fields.hasErrors('rankName')}? 'has-error'">
							<label class="control-label col-md-3">会员等级名称<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="会员等级名称" th:field="*{rankName}"/>
								<span class="help-block" th:if="${#fields.hasErrors('rankName')}" th:errors="*{rankName}">用户名称不能为空</span>
							</div>
						</div>
						<div class="form-group" th:classappend="${#fields.hasErrors('minRank')}? 'has-error'">
							<label class="control-label col-md-3">积分下限<span class="required">* </span></label>							
							<div class="col-md-4">
								<input  type="text" class="form-control" placeholder="积分下限" th:field="*{minRank}"/>
								<span class="help-block" th:if="${#fields.hasErrors('minRank')}" th:errors="*{minRank}"></span>
							</div>
						</div>
						<div class="form-group" th:classappend="${#fields.hasErrors('maxRank')}? 'has-error'">
							<label class="control-label col-md-3">积分上限<span class="required">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="积分上限" th:field="*{maxRank}"/>
								<span class="help-block" th:if="${#fields.hasErrors('maxRank')}" th:errors="*{maxRank}"></span>
							</div>
						</div>
						<div class="form-group" th:classappend="${#fields.hasErrors('goodsSale')}? 'has-error'">
							<label class="control-label col-md-3">商品折扣<span class="required">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="商品折扣" th:field="*{goodsSale}"/>
								<span class="help-block" th:if="${#fields.hasErrors('goodsSale')}" th:errors="*{goodsSale}"></span>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-md-3">是否显示会员价格<span class="required" aria-required="true">* </span></label>
							<div class="col-md-4">
								<div class="radio-list">
									<label class="radio-inline"><span><input type="radio" name="isShow"  id="optionsRadios2" value="true" checked="" th:field="*{isRankPrice}" /></span> 是</label>
									<label class="radio-inline"><span><input type="radio" name="isShow" id="optionsRadios3" value="false" th:field="*{isRankPrice}" /></span> 否</label>
								</div>						
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-md-3">是否特殊等级<span class="required" aria-required="true">* </span></label>
							<div class="col-md-4">
								<div class="radio-list">
									<label class="radio-inline"><span><input type="radio" name="isShow"  id="optionsRadios4" value="true" checked="" th:field="*{isSpecial}" /></span> 是</label>
									<label class="radio-inline"><span><input type="radio" name="isShow" id="optionsRadios5" value="false" th:field="*{isSpecial}" /></span> 否</label>
								</div>						
							</div>
						</div>
					</div>	
					<div class="form-actions fluid">
						<div class="col-md-offset-3 col-md-9">
							<button type="submit" id="btn_submit" class="btn blue">提交</button>
						</div>
					</div>
				</form>		
			</div>
		</div>
	</div>
</div>	
</body>
</html>
<script th:inline="javascript">
    /*<![CDATA[*/
    $(document).ready(function(){
        $("#form").validate({
            rules:{
                rankName:{
                    required:true,
                    maxlength:50
                },
                minRank: {
                    required: true,
                    digits: true,
                    min:1,
                    max:99999
                },
                maxRank : {
                    required: true,
                    digits: true,
                    min:1,
                    max:99999
                },
                goodsSale: {
                    required: true,
                    digits: true,
                    min:0,
                    max:100
                }
            }

        });
    });

    /*]]>*/
</script>